﻿using FluentValidation;
using Nop.Plugin.Misc.MessageDesigner.Models;
using Nop.Services.Localization;
using Nop.Web.Framework.Validators;

namespace Nop.Plugin.Misc.MessageDesigner.Validators
{
    public class MessageDesignValidator : BaseNopValidator<MessageDesignModel>
    {
        public MessageDesignValidator(ILocalizationService localizationService)
        {
            RuleFor(x => x.Name).NotEmpty().WithMessage(localizationService.GetResource("Plugins.Misc.MessageDesigner.Fields.Name.Required"));
            RuleFor(x => x.Body).NotEmpty().WithMessage(localizationService.GetResource("Plugins.Misc.MessageDesigner.Fields.Body.Required"));
        }
    }
}